/**
 * @Description:
 * @Author: CHEHSHUANG
 * @Date: 2019/1/23
 */
import httpUtils from "../../../commons/utils/FeatchUtils";
import {basicUrl} from "../../../configs/DefaultConfig";
//查询所有租户
export const listAllTenant = () => {
    return httpUtils.get(basicUrl + "/tenant/findAll")
}
//保存租户信息
export const save = (params = {}) => {
    return httpUtils.postJson(basicUrl + "/tenant/save", JSON.stringify(params))
}
//查询部门根结点
export const findRootByTenantCode = (tenantCode) => {
    return httpUtils.get(basicUrl + "/organization/findRootByTenantCode",{tenantCode})
}
//查询租户管理员
export const findAdminByTenantCode = (tenantCode) => {
    return httpUtils.get(basicUrl + "/employee/findAdminByTenantCode",{tenantCode})
}
//查询所有应用模块
export const listAllAppModule = () => {
    return httpUtils.get(basicUrl + "/appModule/findAll")
}
//查询分配给租户的应用模块
export const findTenantAppModule = (tenantId) => {
    return httpUtils.get(basicUrl + "/tenantAppModule/getChildrenFromParentId",{parentId: tenantId})
}
//保存部门根结点
export const saveDepartmentRoot = (rootDepartment={}) => {
    return httpUtils.postJson(basicUrl + "/organization/save",rootDepartment)
}
//保存租户管理员
export const saveTenantAdmin = (tenantAdmin={}) => {
    return httpUtils.postJson(basicUrl + "/employee/save",tenantAdmin)
}
//保存租户的应用模块
export const saveTenantAppModules = (tenantApp={}) => {
    return httpUtils.postJson(basicUrl + "/tenantAppModule/insertRelationsByParam",tenantApp)
}
